// $ANTLR 3.3 Nov 30, 2010 12:45:30 C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g 2011-01-09 15:34:45

//import simplecalcparser.datastructures.types.*;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

public class SimpleCalcParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "SEMI_COL", "SENSOR_TAG", "ACTUATOR_TAG", "BEHAVIOUR_TAG", "NAME_TAG", "OPEN_TAG", "CLOSE_TAG_with_quote", "XML_HEADER_TAG1", "XML_HEADER_TAG2_PART2", "XML_HEADER_TAG2_PART3", "XML_HEADER_TAG2_PART4", "DIAGRAM_TAG", "END_CLOSING_TAG", "CLOSE_TAG", "NAME", "WHITESPACE", "DIGIT", "' '"
    };
    public static final int EOF=-1;
    public static final int T__21=21;
    public static final int SEMI_COL=4;
    public static final int SENSOR_TAG=5;
    public static final int ACTUATOR_TAG=6;
    public static final int BEHAVIOUR_TAG=7;
    public static final int NAME_TAG=8;
    public static final int OPEN_TAG=9;
    public static final int CLOSE_TAG_with_quote=10;
    public static final int XML_HEADER_TAG1=11;
    public static final int XML_HEADER_TAG2_PART2=12;
    public static final int XML_HEADER_TAG2_PART3=13;
    public static final int XML_HEADER_TAG2_PART4=14;
    public static final int DIAGRAM_TAG=15;
    public static final int END_CLOSING_TAG=16;
    public static final int CLOSE_TAG=17;
    public static final int NAME=18;
    public static final int WHITESPACE=19;
    public static final int DIGIT=20;

    // delegates
    // delegators


        public SimpleCalcParser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public SimpleCalcParser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        

    public String[] getTokenNames() { return SimpleCalcParser.tokenNames; }
    public String getGrammarFileName() { return "C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g"; }

     	    
        public static void main(String[] args) throws Exception {
            
            SimpleCalcLexer lex = new SimpleCalcLexer(new ANTLRFileStream(args[0]));
           	CommonTokenStream tokens = new CommonTokenStream(lex);

            SimpleCalcParser parser = new SimpleCalcParser(tokens);

            try {
                parser.fichier_xmi();
            } catch (RecognitionException e)  {
                e.printStackTrace();
            }
        }



    // $ANTLR start "fichier_xmi"
    // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:56:1: fichier_xmi : XML_HEADER_TAG1 OPEN_TAG name XML_HEADER_TAG2_PART2 name XML_HEADER_TAG2_PART3 name XML_HEADER_TAG2_PART4 sensor END_CLOSING_TAG NAME DIAGRAM_TAG CLOSE_TAG ;
    public final void fichier_xmi() throws RecognitionException {
        try {
            // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:56:13: ( XML_HEADER_TAG1 OPEN_TAG name XML_HEADER_TAG2_PART2 name XML_HEADER_TAG2_PART3 name XML_HEADER_TAG2_PART4 sensor END_CLOSING_TAG NAME DIAGRAM_TAG CLOSE_TAG )
            // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:56:15: XML_HEADER_TAG1 OPEN_TAG name XML_HEADER_TAG2_PART2 name XML_HEADER_TAG2_PART3 name XML_HEADER_TAG2_PART4 sensor END_CLOSING_TAG NAME DIAGRAM_TAG CLOSE_TAG
            {
            match(input,XML_HEADER_TAG1,FOLLOW_XML_HEADER_TAG1_in_fichier_xmi158); 
            match(input,OPEN_TAG,FOLLOW_OPEN_TAG_in_fichier_xmi167); 
            pushFollow(FOLLOW_name_in_fichier_xmi169);
            name();

            state._fsp--;

            match(input,XML_HEADER_TAG2_PART2,FOLLOW_XML_HEADER_TAG2_PART2_in_fichier_xmi171); 
            pushFollow(FOLLOW_name_in_fichier_xmi173);
            name();

            state._fsp--;

            match(input,XML_HEADER_TAG2_PART3,FOLLOW_XML_HEADER_TAG2_PART3_in_fichier_xmi175); 
            pushFollow(FOLLOW_name_in_fichier_xmi177);
            name();

            state._fsp--;

            match(input,XML_HEADER_TAG2_PART4,FOLLOW_XML_HEADER_TAG2_PART4_in_fichier_xmi179); 
            pushFollow(FOLLOW_sensor_in_fichier_xmi188);
            sensor();

            state._fsp--;

            match(input,END_CLOSING_TAG,FOLLOW_END_CLOSING_TAG_in_fichier_xmi197); 
            match(input,NAME,FOLLOW_NAME_in_fichier_xmi199); 
            match(input,DIAGRAM_TAG,FOLLOW_DIAGRAM_TAG_in_fichier_xmi201); 
            match(input,CLOSE_TAG,FOLLOW_CLOSE_TAG_in_fichier_xmi203); 

            		// code to do after parsing
            	      

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "fichier_xmi"


    // $ANTLR start "sensor"
    // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:69:1: sensor : OPEN_TAG SENSOR_TAG WHITESPACE NAME_TAG name CLOSE_TAG_with_quote ;
    public final void sensor() throws RecognitionException {
        String name1 = null;


        try {
            // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:69:8: ( OPEN_TAG SENSOR_TAG WHITESPACE NAME_TAG name CLOSE_TAG_with_quote )
            // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:69:11: OPEN_TAG SENSOR_TAG WHITESPACE NAME_TAG name CLOSE_TAG_with_quote
            {
            match(input,OPEN_TAG,FOLLOW_OPEN_TAG_in_sensor224); 
            match(input,SENSOR_TAG,FOLLOW_SENSOR_TAG_in_sensor226); 
            match(input,WHITESPACE,FOLLOW_WHITESPACE_in_sensor228); 
            match(input,NAME_TAG,FOLLOW_NAME_TAG_in_sensor230); 
            pushFollow(FOLLOW_name_in_sensor232);
            name1=name();

            state._fsp--;

            match(input,CLOSE_TAG_with_quote,FOLLOW_CLOSE_TAG_with_quote_in_sensor234); 
            			
            			//add_sensor(name1);
            			System.out.println("Sensor name is : " + name1);
            		

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "sensor"


    // $ANTLR start "name"
    // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:76:1: name returns [String value] : NAME ;
    public final String name() throws RecognitionException {
        String value = null;

        Token NAME2=null;

        try {
            // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:76:29: ( NAME )
            // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:77:6: NAME
            {
            NAME2=(Token)match(input,NAME,FOLLOW_NAME_in_name262); 
            value = (NAME2!=null?NAME2.getText():null);

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return value;
    }
    // $ANTLR end "name"


    // $ANTLR start "behaviour"
    // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:79:1: behaviour : OPEN_TAG BEHAVIOUR_TAG ' ' NAME_TAG name CLOSE_TAG ;
    public final void behaviour() throws RecognitionException {
        String name3 = null;


        try {
            // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:79:11: ( OPEN_TAG BEHAVIOUR_TAG ' ' NAME_TAG name CLOSE_TAG )
            // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:79:14: OPEN_TAG BEHAVIOUR_TAG ' ' NAME_TAG name CLOSE_TAG
            {
            match(input,OPEN_TAG,FOLLOW_OPEN_TAG_in_behaviour273); 
            match(input,BEHAVIOUR_TAG,FOLLOW_BEHAVIOUR_TAG_in_behaviour275); 
            match(input,21,FOLLOW_21_in_behaviour277); 
            match(input,NAME_TAG,FOLLOW_NAME_TAG_in_behaviour279); 
            pushFollow(FOLLOW_name_in_behaviour281);
            name3=name();

            state._fsp--;

            match(input,CLOSE_TAG,FOLLOW_CLOSE_TAG_in_behaviour283); 
            System.out.println("behaviour name is : " + name3);

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "behaviour"


    // $ANTLR start "actuator"
    // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:84:1: actuator : OPEN_TAG ACTUATOR_TAG ' ' NAME_TAG name CLOSE_TAG ;
    public final void actuator() throws RecognitionException {
        String name4 = null;


        try {
            // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:84:10: ( OPEN_TAG ACTUATOR_TAG ' ' NAME_TAG name CLOSE_TAG )
            // C:\\Users\\b\\Documents\\PRJ\\robotique_projet\\my_antlr_program\\SimpleCalc.g:84:13: OPEN_TAG ACTUATOR_TAG ' ' NAME_TAG name CLOSE_TAG
            {
            match(input,OPEN_TAG,FOLLOW_OPEN_TAG_in_actuator304); 
            match(input,ACTUATOR_TAG,FOLLOW_ACTUATOR_TAG_in_actuator306); 
            match(input,21,FOLLOW_21_in_actuator308); 
            match(input,NAME_TAG,FOLLOW_NAME_TAG_in_actuator310); 
            pushFollow(FOLLOW_name_in_actuator312);
            name4=name();

            state._fsp--;

            match(input,CLOSE_TAG,FOLLOW_CLOSE_TAG_in_actuator314); 
            System.out.println("actuator name is : " + name4);

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end "actuator"

    // Delegated rules


 

    public static final BitSet FOLLOW_XML_HEADER_TAG1_in_fichier_xmi158 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_OPEN_TAG_in_fichier_xmi167 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_name_in_fichier_xmi169 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_XML_HEADER_TAG2_PART2_in_fichier_xmi171 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_name_in_fichier_xmi173 = new BitSet(new long[]{0x0000000000002000L});
    public static final BitSet FOLLOW_XML_HEADER_TAG2_PART3_in_fichier_xmi175 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_name_in_fichier_xmi177 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_XML_HEADER_TAG2_PART4_in_fichier_xmi179 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_sensor_in_fichier_xmi188 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_END_CLOSING_TAG_in_fichier_xmi197 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_NAME_in_fichier_xmi199 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_DIAGRAM_TAG_in_fichier_xmi201 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_CLOSE_TAG_in_fichier_xmi203 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OPEN_TAG_in_sensor224 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_SENSOR_TAG_in_sensor226 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_WHITESPACE_in_sensor228 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_NAME_TAG_in_sensor230 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_name_in_sensor232 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_CLOSE_TAG_with_quote_in_sensor234 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NAME_in_name262 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OPEN_TAG_in_behaviour273 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_BEHAVIOUR_TAG_in_behaviour275 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_21_in_behaviour277 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_NAME_TAG_in_behaviour279 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_name_in_behaviour281 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_CLOSE_TAG_in_behaviour283 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OPEN_TAG_in_actuator304 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_ACTUATOR_TAG_in_actuator306 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_21_in_actuator308 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_NAME_TAG_in_actuator310 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_name_in_actuator312 = new BitSet(new long[]{0x0000000000020000L});
    public static final BitSet FOLLOW_CLOSE_TAG_in_actuator314 = new BitSet(new long[]{0x0000000000000002L});

}